<div class="navbar navbar-inverse navbar-fixed-top" style="position: fixed; margin-left: 0px; margin-right: 0px">
    <div class="navbar-inner">
        <div class="container-fluid">
            <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse" no-jqload>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </a>
            <a class="brand" href="{{ url_for('index') }}">Gridlock Exchange</a>
            <div class="nav-collapse collapse navbar-responsive-collapse">
                <ul class="nav">
                    <li><a href="{{ url_for('item_index') }}">{{ _('Items') }}</a></li>
                    {% if current_user.is_authenticated() %}
                        <li><a href="{{ url_for('message_index') }}">{{ _('Messages') }}</a></li>
                        <li><a href="{{ url_for('collection_index') }}">{{ _('Collections') }}</a></li>
                    {% endif %}
                    {% if current_user.has_role('admin') %}
                        <li><a href="{{ url_for('user_index') }}">{{ _('Users') }}</a></li>
                        <li><a href="{{ url_for('partners') }}">{{ _('Partners') }}</a></li>
                    {% endif %}
                </ul>
                <form class="navbar-search pull-left" method="get" action="{{ url_for('item_index') }}">
                    <input type="text" id="q" name="q" class="search-query span2" placeholder="{{ _('Search') }}" autocomplete="off" data-provide="typeahead"
                            {% if 'q' in request.args %}
                            value="{{ request.args['q'] }}"
                            {% endif %}
                            >
                </form>
                {% if logout_form %}
                    <form method="post" action="{{ url_for('logout') }}" class="navbar-form pull-right">
                        {{ logout_form.csrf_token }}
                        <input type="submit" class="btn btn-inverse" value="{{ _('Logout') }}">
                    </form>
                {% endif %}
                <p class="navbar-text pull-right">
                    {% if current_user.is_authenticated() %}
                    <a href="{{ current_user.url() }}" class="navbar-link">{{ current_user.display_name }}</a>
                    {% endif %}
                </p>
                <ul class="nav pull-right">
                    <li class="divider-vertical"></li>
                    {% if not current_user.is_authenticated() %}
                        <li><a href="{{ url_for('login') }}" no-jqload>{{ _('Login') }}</a></li>
                    {% endif %}
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" no-jqload>{{ lang.display_name }} <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                            {% for code, name in langs.iteritems() %}
                                <li><a href="{{ url_for('index', next=request.url) }}?lang={{ code }}" no-jqload>{{ name }}</a></li>
                            {% endfor %}
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>
